<template>
    <div class="mui-numbox" data-numbox-min="1">
		<button class="mui-btn mui-btn-numbox-minus" type="button">-</button>
		<input id="test" class="mui-input-numbox" type="number" value="1" ref='number' @change="changeCount">
		<button class="mui-btn mui-btn-numbox-plus" type="button">+</button>
	</div>
</template>

<script>
import mui from '../../lib/mui/js/mui.min.js'
export default {
    props:['max'],
    methods:{
        // 获取numberbox数值
        changeCount(){
            var num = parseInt(this.$refs.number.value)
            this.$emit('numberVal',num)
        }
    },
    mounted(){  
        mui('.mui-numbox').numbox()
    },
    watch:{
        max : function (nVal,oVal) {
            mui('.mui-numbox').numbox().setOption('max',nVal)
        }
    } 
}
</script>

<style lang="less" scoped>
</style>